import axios from '../utils/aicchttp' // 导入http中创建的axios实例
const base_url = process.env.AICC_BASE_API
const inter_url = '/app-api/aicc/seats/'

//呼叫模块坐席接口
const aiccSeatApi = {
  // 判断是否有坐席权限
  getSeatPermission() {
    let url = 'get-permission'
    return axios.get(`${base_url}${inter_url}${url}?satoken=`+localStorage.getItem('token'));
  },
  // 坐席详情
  getSeatDetail(param) {
    param.satoken=localStorage.getItem('token')
    let url = 'get-detail'
    return axios.post(`${base_url}${inter_url}${url}`,param);
  },
  // 坐席外显号码
  getSeatTels(param) {
    param.satoken=localStorage.getItem('token')
    let url = 'get_tels'
    return axios.post(`${base_url}${inter_url}${url}`,param);
  },
  // 绑定座席电话
  bindClientTel(param) {
    param.satoken=localStorage.getItem('token')
    let url = 'bind-tel'
    return axios.post(`${base_url}${inter_url}${url}`,param);
  },
  // 解绑座席电话
  unBindClientTel(param) {
    param.satoken=localStorage.getItem('token')
    let url = 'unbind-tel'
    return axios.post(`${base_url}${inter_url}${url}`,param);
  },
  // 删除座席电话
  delClientTel(param) {
    param.satoken=localStorage.getItem('token')
    let url = 'del-tel'
    return axios.post(`${base_url}${inter_url}${url}`,param);
  },
  // 更新座席
  updateSeat(param) {
    param.satoken=localStorage.getItem('token')
    let url = 'update-client'
    return axios.post(`${base_url}${inter_url}${url}`,param);
  }
}
export default aiccSeatApi
